package com.bluetrum.devicemanager.cmd.payloadhandler;

import androidx.annotation.NonNull;

import com.bluetrum.devicemanager.models.BassEngineRange;

public class BaseEngineRangePayloadHandler extends PayloadHandler<BassEngineRange> {

    public BaseEngineRangePayloadHandler(@NonNull byte[] payload) {
        super(payload);
    }

    @Override
    public BassEngineRange call() throws Exception {
        final byte[] payload = getPayload();
        if (payload.length == 2) {
            byte minValue = payload[0];
            byte maxValue = payload[1];
            return new BassEngineRange(minValue, maxValue);
        }
        return null;
    }

}
